﻿using Bogus;
using CommunityToolkit.Mvvm.ComponentModel;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace WPFDemoMVVM.Model
{
    public partial class EmployeeModel:ObservableObject
    {
        public int Index { get; set; }
        public int Id { get; set; }
        public string Name { get; set; }
        public int Salary { get; set; }

        [ObservableProperty]
        bool isSelected;

        public static EmployeeModel FakeOne() => employeeFaker.Generate();

        public static IEnumerable<EmployeeModel> FakeMany(int count)=> employeeFaker.Generate(count);

        private static readonly Faker<EmployeeModel> employeeFaker = new Faker<EmployeeModel>()
            .RuleFor(x => x.Id, x => x.IndexFaker)
            .RuleFor(x => x.Name, x => x.Person.FirstName)
            .RuleFor(x=>x.Salary,x=>x.Random.Int(6,30)*1000);
    }
}
